package com.foreknow.elmboot_demo.service.impl;

import com.foreknow.elmboot_demo.mapper.OrdersMapper;
import com.foreknow.elmboot_demo.po.Orders;
import com.foreknow.elmboot_demo.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public int createOrders(Orders orders) {
        return ordersMapper.createOrders(orders);
    }

    @Override
    public int updateOrders(Orders orders) {
        return ordersMapper.updateOrders(orders);
    }

    @Override
    public Orders getOrdersById(Integer orderId) {
        return ordersMapper.getOrdersById(orderId);
    }

    @Override
    public List<Orders> listOrdersByUserId(String userId) {
        return ordersMapper.listOrdersByUserId(userId);
    }
}
